package com.ruoyi.kuaipai.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.kuaipai.mapper.KpPointDetailsMapper;
import com.ruoyi.kuaipai.domain.KpPointDetails;
import com.ruoyi.kuaipai.service.IKpPointDetailsService;

/**
 * 点数明细Service业务层处理
 *
 * @author 金龙
 * @date 2025-04-26
 */
@Service
public class KpPointDetailsServiceImpl implements IKpPointDetailsService {
    @Autowired
    private KpPointDetailsMapper kpPointDetailsMapper;

    /**
     * 查询点数明细
     *
     * @param id 点数明细主键
     * @return 点数明细
     */
    @Override
    public KpPointDetails selectKpPointDetailsById(Long id) {
        return kpPointDetailsMapper.selectKpPointDetailsById(id);
    }

    /**
     * 查询点数明细列表
     *
     * @param kpPointDetails 点数明细
     * @return 点数明细
     */
    @Override
    public List<KpPointDetails> selectKpPointDetailsList(KpPointDetails kpPointDetails) {
        return kpPointDetailsMapper.selectKpPointDetailsList(kpPointDetails);
    }

    /**
     * 新增点数明细
     *
     * @param kpPointDetails 点数明细
     * @return 结果
     */
    @Override
    public int insertKpPointDetails(KpPointDetails kpPointDetails) {
        kpPointDetails.setCreateTime(new Date());
        return kpPointDetailsMapper.insertKpPointDetails(kpPointDetails);
    }

    /**
     * 修改点数明细
     *
     * @param kpPointDetails 点数明细
     * @return 结果
     */
    @Override
    public int updateKpPointDetails(KpPointDetails kpPointDetails) {
        kpPointDetails.setUpdateTime(new Date());
        return kpPointDetailsMapper.updateKpPointDetails(kpPointDetails);
    }

    /**
     * 批量删除点数明细
     *
     * @param ids 需要删除的点数明细主键
     * @return 结果
     */
    @Override
    public int deleteKpPointDetailsByIds(Long[] ids) {
        return kpPointDetailsMapper.deleteKpPointDetailsByIds(ids);
    }

    /**
     * 删除点数明细信息
     *
     * @param id 点数明细主键
     * @return 结果
     */
    @Override
    public int deleteKpPointDetailsById(Long id) {
        return kpPointDetailsMapper.deleteKpPointDetailsById(id);
    }
}
